/*
 * @(#)XfdmAlgorithmFactory.java        1.0 2000/05/09
 *
 * This file is part of Xfuzzy 3.0, a design environment for fuzzy logic
 * based systems.
 *
 * (c) 2000 IMSE-CNM. The authors may be contacted by the email address:
 *                    xfuzzy-team@imse.cnm.es
 *
 * Xfuzzy is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by
 * the Free Software Foundation.
 *
 * Xfuzzy is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 */

package xfuzzy.xfdm.model;

import xfuzzy.xfdm.model.algorithm.*;

/**
 * Clase permite construir los diferentes algoritmos
 * 
 * @author Francisco Jos� Moreno Velo
 *
 */
public class XfdmAlgorithmFactory {

	//----------------------------------------------------------------------------//
	//                             M�TODOS P�BLICOS                               //
	//----------------------------------------------------------------------------//

	/**
	 * Crea un algoritmo a partir de su identificador
	 */
	public static XfdmAlgorithm create(String name, double[] param) {
		if(name.equals("Flat")) return new XfdmFlatSystem();
		else if(name.equals("FuzzyID3")) return new XfdmFuzzyID3(param[0]);
		else if(name.equals("WangMendel")) return new XfdmWangMendel();
		else if(name.equals("FuzzConRI")) return new XfdmFuzzConRI((int) param[0],param[1],param[2]);
		else if(name.equals("FuzzyCN2")) return new XfdmFuzzyCN2((int) param[0],param[1],param[2],param[3],(int) param[4]);
		else if(name.equals("Nauck")) return new XfdmNauck(param);
		else if(name.equals("Senhadji")) return new XfdmSenhadji(param);
		else if(name.equals("IncGrid")) return new XfdmIncGrid(param);
		else if(name.equals("IncClustering")) return new XfdmIncClustering(param);
		else if(name.equals("HardCMeans")) return new XfdmFixedClustering(XfdmFixedClustering.HARD_CMEANS,param);
		else if(name.equals("CMeans")) return new XfdmFixedClustering(XfdmFixedClustering.CMEANS,param);
		else if(name.equals("GustafsonKessel")) return new XfdmFixedClustering(XfdmFixedClustering.GUSTAFSON_KESSEL,param);
		else if(name.equals("GathGeva")) return new XfdmFixedClustering(XfdmFixedClustering.GATH_GEVA,param);
		else return null;
	}

}


